package com.kqb.sgpicturebackend.service;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.kqb.sgpicturebackend.model.dto.picture.*;
import com.kqb.sgpicturebackend.model.pojo.Picture;
import com.kqb.sgpicturebackend.model.pojo.User;
import com.kqb.sgpicturebackend.model.vo.PictureVO;
import org.springframework.web.multipart.MultipartFile;

import java.util.List;

/**
 * @author D
 * @description 针对表【picture(图片)】的数据库操作Service
 * @createDate 2025-04-28 14:10:53
 */
public interface PictureService extends IService<Picture> {
    /**
     * 上传图片
     *
     * @param inputSource
     * @param loginUser   当前登录用户
     * @return
     */
    PictureVO uploadPicture(Object inputSource, PictureUploadRequest pictureUploadRequest, User loginUser);

    /**
     * 删除图片
     *
     * @param id        图片id
     * @param loginUser 当前登录用户
     * @return
     */
    boolean deletePictureById(Long id, User loginUser);

    /**
     * 查询图片列表(用户)
     *
     * @param pictureQueryRequest
     * @return
     */
    Page<PictureVO> queryPictureVoListPage(PictureQueryRequest pictureQueryRequest);

    /**
     * 查询图片列表(管理员)
     *
     * @param pictureQueryRequest
     * @return
     */
    Page<Picture> queryPictureListPage(PictureQueryRequest pictureQueryRequest);

    /**
     * 获取查询条件
     *
     * @param pictureQueryRequest
     * @return
     */
    QueryWrapper<Picture> getQueryWapper(PictureQueryRequest pictureQueryRequest);

    /**
     * 编辑图片
     *
     * @param pictureEditRequest
     * @param loginUser
     * @return
     */
    void editPicture(PictureEditRequest pictureEditRequest, User loginUser);


    void validPicture(Picture picture);

    /**
     * 审核图片(管理员）
     *
     * @param pictureReviewRequest
     * @param loginUser
     */
    void reviewPicture(PictureReviewRequest pictureReviewRequest, User loginUser);

    /**
     * 批量上传图片(抓取）
     *
     * @param uploadByBatchRequest
     * @param loginUser
     * @return
     */
    int uploadPictureByBatch(PictureUploadByBatchRequest uploadByBatchRequest, User loginUser);
}
